home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000036_icon-group-sender_Wed Mar 12 12:53:03 2003.msg < prev    next >
Internet Message Format  |  2003-12-22  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2CJpgM04093
  4.     for icon-group-addresses; Wed, 12 Mar 2003 12:51:42 -0700 (MST)
  5. Message-Id: <200303121951.h2CJpgM04093@baskerville.CS.Arizona.EDU>
  6. X-Sender: whm@mail.mse.com
  7. Date: Wed, 12 Mar 2003 09:43:20 -0700
  8. To: icon-group@cs.arizona.edu
  9. From: "William H. Mitchell" <whm@mse.com>
  10. Subject: Re: Sorting lists
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13.  
  14. A list of lists is sorted by time of creation, oldest first.  That's
  15. usually not very useful.  sortf(L,i) sorts a list of lists by the value of
  16. the i-th element of the sublists.  Assuming your example depicts a list of
  17. lists containing strings, sortf(L, 1) would produce the result you hope for.
  18.  
  19. At 02:21 PM 3/12/03 +0000, rjhare@ed.ac.uk wrote:
  20. >I don't have the book to hand and am sitting in an Icon-free zone at
  21. >the moment. What do I get if I sort a list of lists like this:
  22. >
  23. >[ [b,c], [a,d] ]
  24. >
  25. >I hope I get:
  26. >
  27. >[ [a,d], [b,c]]
  28. >
  29. >but fear that I might get:
  30. >
  31. >[ a, b, c, d]
  32.  
  33.